package com.misakyanls.examples;

import java.io.PrintStream;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Locale;

import org.springframework.util.NumberUtils;

public class BigDecimalTest {

	public static void main(String[] args) throws ParseException {
		PrintStream os = System.out;
		NumberFormat numberFormat = NumberFormat.getInstance(new Locale("ru", "RU"));
		Number bigDecimal = NumberUtils.parseNumber("1,5", BigDecimal.class, numberFormat);
		os.println(numberFormat.format(((BigDecimal) bigDecimal).multiply(BigDecimal.TEN)));
		os.println(BigDecimal.TEN.toString());

		/*DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss");

		DateTime time = new DateTime();
		Date date = Calendar.getInstance().getTime();

		os.println("Joda time: " + time);
		os.println("JRE time: " + date);
		
		System.out.println("Java tz: " + TimeZone.getDefault());
		System.out.println("Joda tz: " + ISOChronology.getInstance());
*/	}

}
